﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using App1AppHandler;
using Reborn_Server.App1AppHandler;

namespace Reborn_WorldServer.App1AppHandler
{
    public class DeathEffectCreature : Creature
    {
        //Records information about the caster for when the effect triggers
        public int EffectCasterCharID = -1;
        public int EffectCastLevel = 1;
        public int EffectCasterInt = 0;
        public int EffectCasterWis = 0;
        
        public DeathEffectCreature(AppHandler2 gameHandler) : base(gameHandler) { }

        public override void DropLoot(int SlayingCharID)
        {
            base.DropLoot(SlayingCharID);

            Spell_Burn burn = new Spell_Burn();

            SpellIcon burnIcon = null;
            foreach (KeyValuePair<int, SpellIcon> si in Managers.GameHandler.Spells)
            {
                if (si.Value.Name == "Burn")
                {
                    burnIcon = si.Value;
                    break;
                }
            }

            //burn.PositionCast(burnIcon, EffectCaster, EffectLevel, this.MapX, this.MapY);
            burn.IndirectPositionCast(burnIcon, this, this.MapX, this.MapY, EffectCastLevel, EffectCasterInt, EffectCasterWis, EffectCasterCharID);
        }
    }
}
